# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo8.03
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/4
#-------------------------------------------------------------------------------

# 创建MyClass类
class MyClass:
    # class块中的语句，会立刻执行
    print("MyClass")
    count = 0
    def counter(self):
        self.count += 1
my = MyClass()
my.counter()                   # 调用counter方法
print(my.count)                # 运行结果：1
my.counter()                   # 调用counter方法
print(my.count)                # 运行结果：2
my.count = "abc"               # 将count变量改成字符串类型
print(my.count)                # 运行结果：abc
my.name = "Hello"              # 向my对象动态添加name变量
print(my.name)                 # 运行结果：Hello
